#include<bits/stdc++.h>
using namespace std;
inline int solve(vector<int> a){
  int n=a.size();
  vector<int> s(n),f(n+1,-1e9); f[n]=0;
  partial_sum(a.begin(),a.end(),s.begin());
  auto S=[&](int l,int r){
    return l>r?0:s[r]-(l?s[l-1]:0);
  };
  for(int i=n-1,c=-1e9;i>1;i--){
    c=max(c,a[i]-S(0,i-1)-(i==n-1?0:f[i+1]));
    f[i]=max(f[i],c+S(0,i-1));
  }
  return a[0]-a[1]+f[2];
}
int main(){
  freopen("pockets.in","r",stdin);
  freopen("pockets.out","w",stdout);
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0);
  int n,c=0; cin>>n;
  vector<int> a(n-1);
  for(auto &i:a)cin>>i,c+=i;
  int m; cin>>m;
  while(m--){
    int x; cin>>x;
    if(x>c){cout<<x-c+(a[0]<<1)<<'\n'; continue;}
    a.emplace_back(x);
    cout<<solve(a)<<'\n';
    a.pop_back();
  }
  return 0;
}